package com.cqjtu.graduation.service.impl;

import com.cqjtu.graduation.dao.NoticeDAO;
import com.cqjtu.graduation.entity.NoticeDO;
import com.cqjtu.graduation.service.NoticeDOServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Service
public class NoticeDOServerImpl implements NoticeDOServer {
    @Autowired
    private NoticeDAO noticeDAO;




    @Override
    public NoticeDO latestNotice() {
        List<NoticeDO> noticeDOList=noticeDAO.listNotice();
        NoticeDO noticeDO=noticeDOList.get(0);
        return noticeDO;
    }

    @Override
    public void saveNotice(String noticeContent) {
        noticeDAO.saveNotice(noticeContent);
    }
}
